<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/template/header.jsp"%>

<jsp:useBean id="goodsList" scope="request" class="java.util.ArrayList"></jsp:useBean>
<jsp:useBean id="goods" scope="page" class="com.pricecmp.model.Good"></jsp:useBean>
<jsp:useBean id="goodsTypeList" scope="request"
	class="java.util.ArrayList"></jsp:useBean>

<div class="container">
	<div class="row-fluid">
		<div id="hot_sale_goods">
			<div class="well">
				<h1 class="head">人气热卖</h1>
				<img
					src="<%=request.getContextPath() + "/image/goods/hot_sale1.gif"%>"
					class="img-polaroid" alt=""> <img
					src="<%=request.getContextPath() + "/image/goods/hot_sale2.gif"%>"
					class="img-polaroid" alt=""> <img
					src="<%=request.getContextPath() + "/image/goods/hot_sale3.gif"%>"
					class="img-polaroid" alt="">
			</div>
		</div>
		<div id="goods">
			<div class="well">
				<h1 class="head">搜索结果</h1>
				<ul class="nav nav-pills">
					<li class="disabled"><a href="#">商品类别</a></li>
					<%
						for (int i = 0; i < goodsTypeList.size(); i++) {
							String type = (String) goodsTypeList.get(i);
					%>
					<li><a
						href="<%=request.getContextPath()
						+ "/search/findbycategory?type=" + type%>"><%=type%></a></li>
					<%
						}
					%>
				</ul>
				<%
					int i = 0;
					for (i = 0; i < goodsList.size(); i++) {
						pageContext.setAttribute("goods",
								(com.pricecmp.model.Good) goodsList.get(i));
						if (i % 4 == 0) {
				%>
				<ul class="thumbnails">
					<%
						}
					%>
					<li class="span3">
						<div class="thumbnail">
							<img src="<jsp:getProperty name="goods" property="imgUrl" />"
								class="img-rounded" alt=""> <a
								href="<%=request.getContextPath()
						+ "/search/goodsinfo?goodsid="%><jsp:getProperty name="goods" property="goodId"/>"
								target="_blank"
								title="<jsp:getProperty name="goods" property="name"/>"><p
									class="text-center good_describe"><jsp:getProperty
										name="goods" property="name" /></p></a>
							<p class="text-center">
								<span class="price_money_type">RMB</span> <span
									class="price_money"><jsp:getProperty name="goods"
										property="price" /></span>
							</p>
						</div>
					</li>
					<%
						if ((i + 1) % 4 == 0) {
					%>
				</ul>
				<%
					}
					}
					if ((i + 1) % 4 != 0) {
				%>
				</ul>
				<%
					}
				%>
			</div>
		</div>
	</div>
</div>

<%@include file="/template/footer.jsp"%>